package com.breakfast.fun.data.entity.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/22.
 */
public class City {


    /**
     * total : 2
     * pageTotal : 2
     * data : []
     * msg : 查询成功
     * success : true
     */

    private int total;
    private int pageTotal;
    private String msg;
    private boolean success;
    private List<CityData> data;

    public static City objectFromData(String str) {

        return new Gson().fromJson(str, City.class);
    }

    public static List<City> arrayCityFromData(String str) {

        Type listType = new TypeToken<ArrayList<City>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public List<CityData> getData() {
        return data;
    }

    public void setData(List<CityData> data) {
        this.data = data;
    }
}
